import React from './react';
import ReactDOM from './react-dom';
let rootContainerElement = document.getElementById('root');
// 先注册先执行，因此在root容器中，react事件先执行

const handleDivClick = (event)=>{
  console.log('父元素冒泡');
}
const handleDivClickCapture = (event)=>{
  console.log('父元素捕获');
}
const handleButtonClick = (event)=>{
  console.log('子元素冒泡');
}
const handleButtonClickCapture = (event)=>{
  console.log('event: ',event.isDefaultPrevented);
  console.log('子元素捕获');
}
let element = (
  <div onClick={handleDivClick} onClickCapture={handleDivClickCapture}>
    <button onClick={handleButtonClick} onClickCapture={handleButtonClickCapture}>点击</button>
  </div>
)
console.log(element);
// debugger
ReactDOM.render(
  element,
  rootContainerElement
);

